import BigScreenBase from '@/pages/BigScreenBase'
import BigScreenGovern from '@/pages/BigScreenGovern'
import BigScreenWarn from '@/pages/BigScreenWarn'
import Home from '@/pages/Home'
import { createBrowserRouter } from 'react-router-dom'

const routes = [
  {
    path: '/',
    element: <Home />,
    children: [
      {
        // index: true,
        key: 'bgBaseData',
        path: 'bgBaseData',
        element: <BigScreenBase />
      },
      {
        key: 'bigScreenWarn',
        path: 'bigScreenWarn',
        element: <BigScreenWarn />
      },
      {
        key: 'bigScreenGovern',
        path: 'bigScreenGovern',
        element: <BigScreenGovern />
      }
    ]
  }
]

// const routes = [
//   {
//     path: '/',
//     // element: <Navigate to="/bgBaseData" />,
//     loader: () => {
//       return redirect("/bgBaseData");
//     },
//   },
//   {
//     path: '/bgBaseData',
//     element: <BigScreenBase />
//   },
//   {
//     path: '/bigScreenWarn',
//     element: <BigScreenWarn />
//   },
//   {
//     path: '/bigScreenGovern',
//     element: <BigScreenGovern />
//   }
// ]

export const router = createBrowserRouter(routes, {
  basename: import.meta.env.VITE_ROUTER_BASE_NAME
})
